package com.icoolkj.ms.pay.feign;

import com.icoolkj.ms.common.core.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * 会员服务Feign客户端
 * 该接口应当移动到icoolkj-ms-api-member模块中
 * 这里只是作为过渡，后续应当使用api模块提供的接口
 *
 * @author icoolkj
 */
@FeignClient(name = "icoolkj-ms-member", path = "/member", contextId = "memberClient")
public interface MemberFeignClient {

    /**
     * 更新会员余额
     *
     * @param memberId 会员ID
     * @param amount 金额
     * @return 操作结果
     */
    @PostMapping("/balance/update")
    ServerResponseEntity<Boolean> updateBalance(@RequestParam("memberId") Long memberId, 
                                              @RequestParam("amount") BigDecimal amount);
    
    /**
     * 更新会员会员有效期
     *
     * @param memberId 会员ID
     * @param days 天数
     * @return 操作结果
     */
    @PostMapping("/validity/extend")
    ServerResponseEntity<Boolean> extendValidity(@RequestParam("memberId") Long memberId,
                                               @RequestParam("days") Integer days);
} 